<script>
import outMain from "@/components/outMain.vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { getUserList } from "@/http/api";
export default {
  components: { outMain },
  name: "",
  data() {
    return {
      tableData: [],
      statusArr: [],
      queryData: {
        search: "",
        page: 1,
        per_page: 10,
      },
      total: 0,
    };
  },
  props: {},
  setup() {},
  methods: {
    getData() {
      getUserList(this.queryData).then((res) => {
        if (res.data.code == 1) {
          this.tableData = res.data.data.data;
          this.total = res.data.data.total;
        }
      });
    },
  },
  mounted() {},
  created() {
    this.getData();
  },
};
</script>
<template>
  <outMain>
    <div class="tableCont">
      <div class="tableName flexCont">
        <div>平台用户列表（{{ total }}）</div>
      </div>
      <div class="tableSerch">
        <div class="serchLeft"></div>
        <div class="serchRight">
          <el-form class="flexCenter" :inline="true">
            <el-form-item>
              <el-input
                clearable
                @clear="getData"
                @keyup.enter="getData"
                v-model="queryData.search"
                placeholder="请输入用户昵称|编号"
              />
            </el-form-item>
            <btn value="搜索" @click="getData"></btn>
          </el-form>
        </div>
      </div>
      <el-table class="tableMain" :data="tableData" stripe style="width: 100%">
        <el-table-column prop="comName" show-overflow-tooltip label="用户头像">
          <template #default="{ row }">
            <img class="userImg" :src="row.head_img" />
          </template>
        </el-table-column>
        <el-table-column
          prop="nick_name"
          show-overflow-tooltip
          label="用户昵称"
        />
        <el-table-column prop="comUser" show-overflow-tooltip label="简历状态">
          <template #default="{ row }">
            <el-tag type="info" v-if="row.is_user_biographical_notes == 1"
              >未完善</el-tag
            >
            <el-tag v-if="row.is_user_biographical_notes == 2">已完善</el-tag>
          </template>
        </el-table-column>

        <el-table-column
          prop="last_fw_time"
          show-overflow-tooltip
          label="最近登录"
        />
        <el-table-column
          prop="create_time"
          show-overflow-tooltip
          label="创建时间"
        />
      </el-table>
      <div class="pageCont">
        <el-pagination
          v-model:currentPage="queryData.page"
          v-model:page-size="queryData.per_page"
          background
          layout="total, prev, pager, next, jumper"
          :total="total"
          @size-change="getData"
          @current-change="getData"
        />
      </div>
    </div>
  </outMain>
</template>
<style scoped lang="less"></style>
